package fm.dongman.modellib.StaticArea;

import android.app.Activity;
import android.content.Context;
import android.support.annotation.NonNull;

import fm.dongman.modellib.local.FArticleLocalDataSource;
import fm.dongman.modellib.local.ComicLocalDataSource;
import fm.dongman.modellib.local.FSheetLocalDataSource;
import fm.dongman.modellib.local.FRankLocalDataSource;
import fm.dongman.modellib.local.HomeLocalDataSource;
import fm.dongman.modellib.local.LoginLocalDataSource;
import fm.dongman.modellib.local.SearchLocalDataSource;
import fm.dongman.modellib.source.ChatEditRepository;
import fm.dongman.modellib.source.ComicInfoRepository;
import fm.dongman.modellib.remote.FArticleRemoteDataSource;
import fm.dongman.modellib.remote.ComicRemoteDataSource;
import fm.dongman.modellib.remote.FRankRemoteDataSource;
import fm.dongman.modellib.remote.HomeRemoteDataSource;
import fm.dongman.modellib.remote.LoginRemoteDataSource;
import fm.dongman.modellib.remote.FSheetRemoteDataSource;
import fm.dongman.modellib.remote.RankInfoRemoteDataSource;
import fm.dongman.modellib.remote.SearchRemoteDataSource;
import fm.dongman.modellib.source.ArticleListRepository;
import fm.dongman.modellib.source.ArticleInfoRepository;
import fm.dongman.modellib.source.ChatListRepository;
import fm.dongman.modellib.source.ComicClassifyRepository;
import fm.dongman.modellib.source.ComicCourierRepository;
import fm.dongman.modellib.source.ComicListRepository;
import fm.dongman.modellib.source.ComicRepository;
import fm.dongman.modellib.source.ComicTimeRepository;
import fm.dongman.modellib.source.CommentEditRepository;
import fm.dongman.modellib.source.CommentListRepository;
import fm.dongman.modellib.source.FArticleRepository;
import fm.dongman.modellib.source.FRankRepository;
import fm.dongman.modellib.source.FSheetRepository;
import fm.dongman.modellib.source.HomeRepository;
import fm.dongman.modellib.source.LoginRepository;
import fm.dongman.modellib.source.MyRepository;
import fm.dongman.modellib.source.RankInfoRepository;
import fm.dongman.modellib.source.RegisterRepository;
import fm.dongman.modellib.source.SearchRepository;
import fm.dongman.modellib.source.SettingRepository;
import fm.dongman.modellib.source.SheetCreateRepository;
import fm.dongman.modellib.source.SheetInfoRepository;
import fm.dongman.modellib.source.SheetListRepository;
import fm.dongman.modellib.source.UserEditRepository;
import fm.dongman.modellib.source.UserInfoRepository;
import fm.dongman.modellib.source.UserListRepository;
import fm.dongman.modellib.source.VideoPlayRepository;

/**
 * 注入类，生成数据源实例
 * Created by shize on 2017/10/10.
 */

public class Injection {
    /**
     * 提供主页数据源
     */
    public static HomeRepository provideHomeRepository(Context context) {
        return HomeRepository.getInstance(HomeRemoteDataSource.getInstance(),
                HomeLocalDataSource.getInstance(context));
    }

    /**
     * 提供用户数据源
     */
    public static LoginRepository provideLoginRepository(Context context) {
        return LoginRepository.getInstance(LoginRemoteDataSource.getInstance(),
                LoginLocalDataSource.getInstance(context));
    }

    /**
     * 提供漫单数据源
     */
    public static FSheetRepository provideFSheetRepository(Context context) {
        return FSheetRepository.getInstance(FSheetRemoteDataSource.getInstance(),
                FSheetLocalDataSource.getInstance(context));
    }

    /**
     * 提供漫圈数据源
     */
    public static FArticleRepository provideFArticleRepository(Context context) {
        return FArticleRepository.getInstance(FArticleRemoteDataSource.getInstance(), FArticleLocalDataSource.getInstance(context));
    }

    /**
     * 提供番剧数据源
     */
    public static ComicRepository provideComicRepository(Context context) {
        return ComicRepository.getInstance(ComicRemoteDataSource.getInstance(), ComicLocalDataSource.getInstance(context));
    }

    /**
     * 提供个人数据源
     */
    public static MyRepository provideMyRepository(Context context) {
        return MyRepository.getInstance(LoginRemoteDataSource.getInstance(), LoginLocalDataSource.getInstance(context));
    }

    /**
     * 榜单数据接口
     */
    public static FRankRepository provideFrankRepository(Context context) {
        return FRankRepository.getInstance(FRankRemoteDataSource.getInstance(), FRankLocalDataSource.getInstance(context));
    }

    /**
     * 搜索数据源
     */
    public static SearchRepository provideSearchRepository(Context context) {
        return SearchRepository.getInstance(SearchRemoteDataSource.getInstance(), SearchLocalDataSource.getInstance(context));
    }


    /**
     * 动漫列表
     */
    @NonNull
    public static ComicListRepository provideComicListRepository() {
        return ComicListRepository.Companion.getInstance();
    }

    /**
     * 文章/漫圈详情
     */
    public static ArticleInfoRepository provideArticleInfoRepository() {
        return ArticleInfoRepository.getInstance();
    }

    /**
     * 漫单/专题详情
     */
    public static SheetInfoRepository provideSheetInfoRepository() {
        return SheetInfoRepository.getInstance();
    }

    /**
     * 漫榜详情
     */
    public static RankInfoRepository provideRankInfoRepository() {
        return RankInfoRepository.getInstance(RankInfoRemoteDataSource.getInstance());
    }

    /**
     * 漫单列表数据源
     */
    public static SheetListRepository provideSheetListRepository() {
        return SheetListRepository.getInstance();
    }

    /**
     * 评论列表
     */
    public static CommentListRepository provideCommentListRepository() {
        return CommentListRepository.getInstance();
    }

    /**
     * 新番速递
     */
    @NonNull
    public static ComicCourierRepository provideComicCourierRepository() {
        return ComicCourierRepository.Companion.getInstance();
    }

    /**
     * 用户详情
     */
    public static UserInfoRepository provideUserInfoRepository() {
        return UserInfoRepository.getInstance();
    }

    /**
     * 获取发现-》漫圈-》分类数据
     */
    public static ArticleListRepository provideArticleListRepository() {
        return ArticleListRepository.getInstance();
    }

    /**
     * 新番分类数据
     */
    @NonNull
    public static ComicClassifyRepository provideComicClassifyRepository() {
        return ComicClassifyRepository.Companion.getInstance();
    }

    /**
     * 获取动漫详细信息
     */
    public static ComicInfoRepository provideComicInfoRemoteDataSource(Context context) {
        return ComicInfoRepository.getInstance(context);
    }

    /**
     * 获取时间表
     */
    @NonNull
    public static ComicTimeRepository provideComicTimeRepository() {
        return ComicTimeRepository.Companion.getInstance();
    }

    /**
     * 用户列表
     */
    public static UserListRepository provideUserListRepository() {
        return UserListRepository.getInstance();
    }

    /**
     * 私信列表
     */
    @NonNull
    public static ChatListRepository provideChatListRepository() {
        return ChatListRepository.Companion.getInstance();
    }

    /**
     * 注册
     */
    public static RegisterRepository provideRegisterRepository() {
        return RegisterRepository.Companion.getInstance();
    }

    /**
     * 设置
     */
    public static SettingRepository provideSettingRepository(Activity activity) {
        return SettingRepository.Companion.getInstance(activity);
    }

    /**
     * 发送评论
     */
    public static CommentEditRepository provideCommentEditRepository() {
        return CommentEditRepository.getInstance();
    }

    /**
     * 发送私信
     */
    public static ChatEditRepository provideChatEditRepository() {
        return ChatEditRepository.getInstance();
    }

    /**
     * 个人资料编辑
     */
    public static UserEditRepository provideUserEditRepository(Context context) {
        return UserEditRepository.getInstance(context);
    }

    /**
     * 编辑/创建漫单
     */
    public static SheetCreateRepository provideSheetCreateRepository() {
        return SheetCreateRepository.Companion.getInstance();
    }

    /**
     * 播放视频标签
     */
    public static VideoPlayRepository provideVideoPlayRepository(){
        return VideoPlayRepository.Companion.getInstance();
    }
}
